#include <common.h>

class Solution {
public:
    int removeElement(vector<int>& nums, int val) {
        int len = nums.size();
        int p=0;
        int cnt = 0;
        for(int i=0;i<len;i++) {
            if(nums[i]!=val) {
                nums[p++]=nums[i];
                cnt++;
            }
        }
        return cnt;
    }
};

int main() {
    auto sp = new Solution();
    vector<int> nums = {3,1,2,3,4,5};
    sp->removeElement(nums,3);
    cout<<printer::int_array_to_string(nums)<<endl;
}